﻿namespace Zocono.Infrastructure.SignalR.Models
{

    public class BytesObjectBase
    {
        #region 通用
        public long PlcConnectionID { get; set; }

        public long PlcReadDbID { get; set; }

        public int BytesIndex { get; set; }

        public int BytesLength { get; set; }

        public int ObjectIndex { get; set; }

        public int ObjectLength { get; set; }

        /// <summary>
        /// 约定：
        /// 1、设备状态报文以State结尾；
        /// 2、Plc的动作报文以PlcAction结尾；
        /// 3、Wcs的动作报文以WcsAction结尾；
        /// 4、平面PLC报文统一PlcState名称
        /// （后续有其他的再约定）
        /// </summary>
        public string ObjectType { get; set; }

        public string EquipmentCode { get; set; }
        #endregion

        #region 平面报文
        public int TaskCode { get; set; }
        public int ToEquipmentCode { get; set; }
        public string PalletBarcode { get; set; }
        public short ActionType { get; set; }
        public byte PalletType { get; set; }
        public byte AlrmCode { get; set; }
        //public short BatteryCount { get; set; }

        //public short IsFull { get; set; }

        /// <summary>
        /// 预留
        /// </summary>
        public byte Reserve { get; set; }
        public byte Reserve2 { get; set; }
        public byte Reserve3 { get; set; }
        public byte Reserve4 { get; set; }
        #endregion

        #region 堆垛机Wcs-PLC
        /// <summary>
        /// 启动命令
        /// </summary>
        public bool Startcommand { get; set; }
        /// <summary>
        /// 报警复位
        /// </summary>
        public bool Alarmreset { get; set; }
        /// <summary>
        /// 自动任务复位
        /// </summary>
        public bool Taskreset { get; set; }
        /// <summary>
        /// WCS消防命令
        /// </summary>
        public bool WCSfirecommand { get; set; }
        /// <summary>
        /// 工作序号
        /// </summary>
        public int Jobnumber { get; set; }
        /// <summary>
        /// 工作命令代码
        /// </summary>
        public short Jobordercode { get; set; }
        /// <summary>
        /// 启始行fromPC
        /// </summary>
        public short StartlinefromPC { get; set; }
        /// <summary>
        /// 启始列fromPC
        /// </summary>
        public short StartcolumnfromPC { get; set; }
        /// <summary>
        /// 启始层fromPC
        /// </summary>
        public short StartlayerfromPC { get; set; }
        /// <summary>
        /// 目标行fromPC
        /// </summary>
        public short TargetlinefromPC { get; set; }
        /// <summary>
        /// 目标列fromPC
        /// </summary>
        public short TargetcolumnfromPC { get; set; }
        /// <summary>
        /// 目标层fromPC
        /// </summary>
        public short TargetlayerfromPC { get; set; }
        /// <summary>
        /// WCS过账完成
        /// </summary>
        public short WCSpostingcompleted { get; set; }
        /// <summary>
        /// 手动任务复位
        /// </summary>
        public short yuliu8 { get; set; }
        public short yuliu9 { get; set; }
        public short yuliu10 { get; set; }
        public short yuliu11 { get; set; }
        public short yuliu12 { get; set; }
        #endregion

        #region 堆垛机PLC-Wcs
        /// <summary>
        /// 堆垛机手自动（1自动，0手动）
        /// </summary>
        public bool StackerHandAutomatic { get; set; }

        /// <summary>
        /// 堆垛机忙（1空闲，0忙）
        /// </summary>
        public bool StackerBusy { get; set; }

        /// <summary>
        /// 货叉左伸出
        /// </summary>
        public bool Forkextendsleft { get; set; }

        /// <summary>
        /// 货叉右伸出
        /// </summary>
        public bool Forkextendsright { get; set; }

        /// <summary>
        /// 货叉有盘
        /// </summary>
        public bool Forkhasaterial { get; set; }

        /// <summary>
        /// 堆垛机报警
        /// </summary>
        public bool StackerAlarm { get; set; }

        /// <summary>
        /// 堆垛机运行信号
        /// </summary>
        public bool Stackerrunningsignal { get; set; }

        /// <summary>
        /// 堆垛机任务完成
        /// </summary>
        public bool StackerTaskCompletion { get; set; }

        /// <summary>
        /// 安全门在线信号
        /// </summary>
        public bool SecurityDooronLine { get; set; }

        /// <summary>
        /// 预留1
        /// </summary>
        public bool yuliu1 { get; set; }

        /// <summary>
        /// 预留2
        /// </summary>
        public bool yuliu2 { get; set; }

        /// <summary>
        /// 预留3
        /// </summary>
        public bool yuliu3 { get; set; }

        /// <summary>
        /// 预留4
        /// </summary>
        public bool yuliu4 { get; set; }

        /// <summary>
        /// 预留5
        /// </summary>
        public bool yuliu5 { get; set; }

        /// <summary>
        /// 预留6
        /// </summary>
        public bool yuliu6 { get; set; }

        /// <summary>
        /// 预留7
        /// </summary>
        public bool yuliu7 { get; set; }

        /// <summary>
        /// 堆垛机报警代码
        /// </summary>
        public short Stackeralarmcode { get; set; }

        /// <summary>
        /// X轴当前位置
        /// </summary>
        public int Xaxiscurrentposition { get; set; }

        /// <summary>
        /// Y轴当前位置
        /// </summary>
        public int Yaxiscurrentposition { get; set; }

        /// <summary>
        /// 当前行
        /// </summary>
        public short Currentline { get; set; }

        /// <summary>
        /// 当前列
        /// </summary>
        public short Currentcolumn { get; set; }

        /// <summary>
        /// 当前层
        /// </summary>
        public short Currentlayer { get; set; }

        /// <summary>
        /// 当前工作序号
        /// </summary>
        public int Currentjobnumber { get; set; }

        /// <summary>
        /// 当前工作命令代码（1入库，2出库，3移库，4移动到：货叉不动作）
        /// </summary>
        public short Currentworkordercode { get; set; }
        /// <summary>
        ///  启始行toPC
        /// </summary>
        public short StartlinetoPC { get; set; }
        /// <summary>
        /// 启始列toPC
        /// </summary>
        public short StartcolumntoPC { get; set; }
        /// <summary>
        ///  启始层toPC
        /// </summary>
        public short StartlayertoPC { get; set; }
        /// <summary>
        /// 目标行toPC
        /// </summary>
        public short TargetlinetoPC { get; set; }

        /// <summary>
        /// 目标列toPC
        /// </summary>
        public short TargetcolumntoPC { get; set; }

        /// <summary>
        /// 目标层toPC
        /// </summary>
        public short TargetlayertoPC { get; set; }

        public short yuliu_1 { get; set; }

        public short yuliu_2 { get; set; }

        public short yuliu_3 { get; set; }

        public short yuliu_4 { get; set; }

        public short yuliu_5 { get; set; }

        public short yuliu_6 { get; set; }

        //public short yuliu16 { get; set; }

        /// <summary>
        /// 取空
        /// </summary>
        public bool TakeEmpty { get; set; }

        /// <summary>
        /// 重入
        /// </summary>
        public bool ReEntery { get; set; }
        #endregion

        public void Serialize(/*long plcConnectionID, long plcReadDbID, int bytesIndex, int bytesLength, int objectIndex, int objectLength, string objectType, string ScEquipmentCode, byte[] bytes*/)
        {
        }



    }
}